#ifndef _NLOG_H_
#define _NLOG_H_
/* Includes ----------------------------------------------------------*/
#include "stdio.h"
/* define ------------------------------------------------------------*/
#define FONT_COLOR_DEBUG	"34"		// blue
#define FONT_COLOR_INFO		"37"		// white
#define FONT_COLOR_WARN		"33"		// yellow
#define FONT_COLOR_ERROR	"31"		// red
#define FONT_COLOR_FATAL	"33"		// yellow

#define BG_COLOR_DEBUG		"0"
#define BG_COLOR_INFO		"0"
#define BG_COLOR_WARN		"0"
#define BG_COLOR_ERROR		"0"
#define BG_COLOR_FATAL		"41"		// red

#define COLOR_END			"\033[0m"
#define COLOR_SET(format, level)	"\033["BG_COLOR_##level";"FONT_COLOR_##level"m"format##COLOR_END

#define NDEBUG(format, ...)		NLOG(COLOR_SET(format, DEBUG), ##__VA_ARGS__)
#define NINFO(format, ...)		NLOG(COLOR_SET(format, INFO), ##__VA_ARGS__)
#define NWARN(format, ...)		NLOG(COLOR_SET(format, WARN), ##__VA_ARGS__)
#define NERROR(format, ...)		NLOG(COLOR_SET(format, ERROR), ##__VA_ARGS__)
#define NFATAL(format, ...)		NLOG(COLOR_SET(format, FATAL), ##__VA_ARGS__)

#define NLOG(format, ...)		printf(format, ##__VA_ARGS__)

/* typedef -----------------------------------------------------------*/
/* macro -------------------------------------------------------------*/
/* variables ---------------------------------------------------------*/
/* function prototypes -----------------------------------------------*/

#endif 
